package org.inspursc.s0517.health.evaluation.service;

import org.inspursc.s0517.health.evaluation.dto.CustomerDTO;
import org.inspursc.s0517.health.evaluation.dto.CustomerToListDTO;
import org.inspursc.s0517.health.evaluation.dto.FindConditionDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author B_Dream
 * @date 2018/5/21 15:44
 */
public interface CustomerService {

    /**
     * 查找所有的客户信息
     *
     * @return
     */
    List<CustomerDTO> findAll();


    /**
     * 根据条件查找客户
     *
     * @param dto
     * @return
     */
    CustomerToListDTO finCustomerListByCondition(FindConditionDTO dto, HttpServletRequest request);


    /**
     * 根据身份证信息查找
     *
     * @param idNumber
     * @return
     */
    CustomerDTO findByIdNumber(String idNumber);

    /**
     * 根据id查找用户
     *
     * @param id
     * @return
     */
    CustomerDTO findById(Integer id);

    /**
     * 根据管理员ID查找所属用户
     *
     * @param belongId
     * @return
     */
    List<CustomerDTO> findByBelongId(Integer belongId);


    /**
     * 根据评估师Id查找用户Id
     *
     * @param appId
     * @return
     */
    List<CustomerDTO> findAllByAppraiserId(Integer appId);


    /**
     * 根据用户信息表ID删除用户
     *
     * @param id
     * @return
     */
    Boolean deleteById(Integer id,HttpServletRequest request) throws Exception;

    /**
     * 根据用户身证ID删除用户
     *
     * @param idNumber
     * @return
     */
    Boolean deleteByIdNumber(String idNumber,HttpServletRequest request) throws Exception;

    /**
     * 保存/修改用户信息
     *
     * @param customer
     * @return
     */
    CustomerDTO save(CustomerDTO customer,HttpServletRequest request) throws Exception;


    /**
     * 获取不同年龄段的统计
     *
     * @return
     */
    Map<String, Integer> getAgeRangeCharts(HttpServletRequest request) ;


}
